package com.bzm.service.bzm.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bzm.common.entity.HttpCode;
import com.bzm.common.entity.JsonResult;
import com.bzm.mapper.bzm.BzmActivityMapper;
import com.bzm.pojo.bzm.BzmActivity;
import com.bzm.service.bzm.BzmActivityService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hemiao
 * @since 2022-10-19
 */
@Service
public class BzmActivityServiceImpl extends ServiceImpl<BzmActivityMapper, BzmActivity> implements BzmActivityService {
	
	@Autowired
	private BzmActivityMapper bzmActivityMapper;
	
	@Override
	public JsonResult<List<BzmActivity>> selectActivityList() {
		QueryWrapper<BzmActivity> queryWrapper = new QueryWrapper<BzmActivity>();
		queryWrapper.orderByAsc("activity_sort");	
		queryWrapper.eq("activity_status", 1);
		List<BzmActivity> list = bzmActivityMapper.selectList(queryWrapper);
		return new JsonResult<List<BzmActivity>>(list, HttpCode.SUCCESS);
	}

}
